import urllib.request

url = 'http://127.0.0.1:8848/web_study/20241030/%E6%96%B0%E9%97%BB%E5%88%97%E8%A1%A8.html'

response = urllib.request.urlopen(url)
print(response.status)
html = response.read()
html = html.decode('utf-8')
print(html)  # 是源代码，后续可能会被异步更新，只能向数据接口发请求

with open('baidu.html', 'w', encoding = 'utf-8') as file:
    file.write(html)